def profile():
	import cProfile, pstats
	import abbrs
	
	with cProfile.Profile() as pr:
		from train import main
		main()
	
	s = io.StringIO()
	pstats.Stats(pr, stream=s).sort_stats(pstats.SortKey.CUMULATIVE).print_stats()
	abbrs.write_file('profile.txt', s.getvalue())

if __name__ == '__main__':
	profile()